package com.example.hj.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Created by HuangJian on 2020/7/22.
 */
@RestController
public class ConsumerController {

    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping("/tc")
    public String testClient() {
        String result=restTemplate.getForEntity("http://eureka-client/tt", String.class).getBody();
        System.out.println("------:"+result);
        return result;
    }
}
